<template>
	<view class="page">
		<view class="consume" v-for="(item,index) in getinfo" :key="index">
			<text class="time">{{item.pay_time}}</text>
			<text class="price">￥{{item.pay_price}}</text>
			<view class="select" @click='toOrderDetail(item.order_id)'>
				<text>查看详情</text>
			</view>
		</view>
	</view>
</template>
<script>
	import ComHeader from "@/components/ComHeader";
	//进入这个页面触发这个onload
	export default {
		onLoad: function(options) {
			/* ————————————进来就调用分享方法，右上角点击即可分享————————————————— */
			//分享参数头url
			let url = this.$api.headurl
			this.$hshare.gethShareParam(url+'/#/pages/my/ConsumeHistory')
			/* ————————————进来就调用分享方法，右上角点击即可分享————————————————— */
			//调用需要的方法 
			this.getMineSale();
		},
		//先赋值一个变量 在调用
		data() {
			return {
				getinfo:[],
			}
		},
		components: {
			ComHeader
		},
		methods: {
			// 获取消费记录信息
			getMineSale() {
				this.$api.getMineSale().then(res => {
					this.getinfo = res.data.data;
					
				})
			},
			//查看订单详情
			toOrderDetail(order_id) {
				uni.navigateTo({
					url: '/pages/order/OrderDetail?order_id='+order_id
				})
			},
			moveHandle() {
			  return;
			},
			
		}
	}
</script>

<style>
	
	.page {
		padding-top: (--status-bar-height);
		width: 100%;
		height: (--status-bar-height);
	}
	.consume {
		display: flex;
		align-items: center;
		width: 750rpx;
		height: 100rpx;
		border: 1rpx solid #eee;
		border-top: none;
	}
	.time {
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(51,51,51,1);
		margin-left: 30rpx;
	}
	.price {
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(255,78,76,1);
		margin-left: 80rpx;
	}
	.select {
		width: 144rpx;
		background: rgba(255,148,0,1);
		border-radius: 10rpx;
		margin-left: 128rpx;
	}
	.select text {
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 28rpx;
		font-family: PingFang SC;
		color: rgba(255,255,255,1);
		font-weight: 500;
	}
</style>
